package cn.jbolt.meinvtu.album;

import java.util.Collections;
import java.util.List;

import com.jfinal.plugin.activerecord.Db;

import cn.jbolt.meinvtu.common.model.Album;

public class AlbumService {
	
	public void deleteAll() {
		Db.delete("delete from album");
	}
	public List<Album> getAllList() {
		return Album.dao.find("select * from album");
	}
	public void deleteByMeinvId(Integer meinvId) {
		Db.delete("delete from album where meinvId=?",meinvId);
	}
	public List<Album> getMeinvAlbums(Integer meinvId) {
		if(meinvId==null||meinvId<=0){return Collections.emptyList();}
		return Album.dao.find("select * from album where meinvId=?",meinvId);
	}

}
